﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Frontend
{
    [Serializable]
    public class StateDictionary : Dictionary<string, object>
    {
        public StateDictionary() : base() 
        { }
        
        StateDictionary(SerializationInfo info, StreamingContext context):
        base(info,context)
        {}

        public void AddValue(string name, bool value) { this[name] = value; }
        public void AddValue(string name, byte value) { this[name] = value; }
        public void AddValue(string name, char value) { this[name] = value; }
        public void AddValue(string name, DateTime value) { this[name] = value; }
        public void AddValue(string name, TimeSpan value) { this[name] = value; }
        public void AddValue(string name, decimal value) { this[name] = value; }
        public void AddValue(string name, double value) { this[name] = value; }
        public void AddValue(string name, float value) { this[name] = value; }
        public void AddValue(string name, int value) { this[name] = value; }
        public void AddValue(string name, long value) { this[name] = value; }
        public void AddValue(string name, sbyte value) { this[name] = value; }
        public void AddValue(string name, short value) { this[name] = value; }
        public void AddValue(string name, uint value) { this[name] = value; }
        public void AddValue(string name, ulong value) { this[name] = value; }
        public void AddValue(string name, ushort value) { this[name] = value; }
        public void AddValue(string name, StateDictionary value) { this[name] = value; }
        public void AddValue(string name, object value) { this[name] = value; }


        public bool GetBoolean(string name) { return (Boolean)this[name]; }
        public byte GetByte(string name) { return (Byte)this[name]; }
        public char GetChar(string name) { return (Char)this[name]; }
        public DateTime GetDateTime(string name) { return (DateTime)this[name]; }
        public TimeSpan GetTimeSpan(string name) { return (TimeSpan)this[name]; }
        public decimal GetDecimal(string name) { return (Decimal)this[name]; }
        public double GetDouble(string name) { return (Double)this[name]; }
        public short GetInt16(string name) { return (Int16)this[name]; }
        public int GetInt32(string name) { return (Int32)this[name]; }
        public long GetInt64(string name) { return (Int64)this[name]; }
        public sbyte GetSByte(string name) { return (SByte)this[name]; }
        public float GetSingle(string name) { return (Single)this[name]; }
        public string GetString(string name) { return (String)this[name]; }
        public ushort GetUInt16(string name) { return (UInt16)this[name]; }
        public uint GetUInt32(string name) { return (UInt32)this[name]; }
        public ulong GetUInt64(string name) { return (UInt64)this[name]; }
        public StateDictionary GetState(string name) { return (StateDictionary)this[name]; }
        public object GetValue(string name) { return this[name]; }


    }
}
